home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3070 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.0 KB

  1. Path: news.cc.uic.edu!sunphy1!olczyk
  2. From: olczyk@sunphy1 (Constantin Rasinariu)
  3. Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
  4. Subject: Re: C++ with Zapp vs. Delphi
  5. Followup-To: comp.lang.c++,comp.lang.pascal.delphi.misc
  6. Date: 22 Jan 1996 02:09:06 GMT
  7. Organization: University of Illinois at Chicago
  8. Message-ID: <4durk2$2r54@tigger.cc.uic.edu>
  9. References: <4coar6$d4n@sun4.bham.ac.uk> <4coip7$69s@news1.usa.pipeline.com> <DBk8wg2yqjbB083yn@iaccess.za> <4d7pmb$48c8@tigger.cc.uic.edu> <4dk38h$gdr@merlin.delphi.com> <4dksp1$3d6c@tigger.cc.uic.edu> <30fe666e.3349285@130.15.126.54>
  10. NNTP-Posting-Host: sunphy1.phy.uic.edu
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. Duncan Murdoch (dmurdoch@mast.queensu.ca) wrote:
  14. : The way this is done in Delphi is to create a descendant of the
  15. : SortedList that overrides the compare method.  Instead of forcing you
  16. : to only put SortedObjects in the list, this allows you to put anything
  17. : there, even non-objects like integers or strings or empty holes, if
  18. : that suits your fancy.
  19.  
  20. : There's not a big difference, but I think this is a little bit
  21. : preferable.  It makes it clear that it's up to the list to know about
  22. : sorting, not up to the object.  That way you can easily put the same
  23. : object in multiple lists with different sorting rules.
  24. Try
  25. class A:SortedObject (CompareTo not overridden)
  26. class B: A ( override with first comparison )
  27. class C: A  (override second comparison )
  28. Of course  with  templates A doesn't have to derive from SortedObject.
  29. It's more type safe that way.
  30.  
  31. OK. Try this one.
  32. You have a class, call it model which contains data and a list
  33. of objects that derive from a 'view' class. Each  'view' class must
  34. derive from a component. Each view class must received new data as it is 
  35. modified in model. Model must recieve data from the view class as it
  36. is changed in the view.
  37. How do you implement this?
  38.  
  39. : P.S. Your newsreader isn't configured properly; it's not giving a
  40. : valid return address (see above).
  41. It's not the reader (that I could fix) it's the mailer.
  42.